import { Component, OnInit } from '@angular/core';
import { Select, Store } from '@ngxs/store';
import { RouterSelector } from './store/router/router.selector';
import { Observable } from 'rxjs';
import { SystemAction } from './store/system/system.action';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
})
export class AppComponent implements OnInit {
  @Select(RouterSelector.url) url$!: Observable<any>;

  constructor(private store: Store) {
  }

  ngOnInit() {
    this.store.dispatch(new SystemAction.Init());
  }
}
